import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// element plus按需导入
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers';
import Icons from 'unplugin-icons/vite'
import IcosResolver from 'unplugin-icons/resolver'


export default defineConfig({
  plugins: [vue(),
  // element plus按需导入
  AutoImport({
    resolvers: [
      //自动导入element plus相关函数
      ElementPlusResolver(),
      IcosResolver({
        prefix: 'Icon'
      })
    ]
  }),
  Components({
    resolvers: [
      //自动导入element plus组件
      ElementPlusResolver(),
      IcosResolver({
        enabledCollections: ['ep']
      })
    ]
  }),
  Icons({
    autoInstall: true
  })

  ]
})
